﻿using System.Collections.Generic;
using System.Runtime.Serialization;
using EzDesk.Core.Model;

namespace EzDesk.Apps.Model.ProjectModule
{
    [DataContract]
    public class WorkitemStatistics
    {
        [DataMember]
        public SimpleUser TargetUser { get; set; }
        [DataMember]
        public string OnTimeCompletionRate { get; set; }
        [DataMember]
        public int WoritemDelaiedCount { get; set; }
        [DataMember]
        public int TotalPoints { get; set; }
        [DataMember]
        public int Index { get; set; }
    }

    public static class WorkitemStatisticsExt
    {
        public static List<WorkitemStatistics> FillIndex(this List<WorkitemStatistics> list)
        {
            foreach (var workitemStatisticse in list)
            {
                workitemStatisticse.Index = list.IndexOf(workitemStatisticse);
            }
            return list;
        }
    }

}